import java.util.Scanner;

class food{
}
class fruit extends  food{

}
class Apple extends  fruit{

}
class Message<T>{
    private T message;
    public T getMessage(){
        return  message;
    }
    public void setMessage( T message){
        this.message=message;
    }
}
public class Test {
    public static void main(String[] args) {
        Message<fruit> message=new Message<>();
        message.setMessage(new fruit());
        fun(message);
    }
    public static  void fun(Message<? super  fruit> temp){
        temp.setMessage(new fruit());//本身
        temp.setMessage(new Apple());//子类
        System.out.println(temp.getMessage());
        Scanner scan=new Scanner(System.in);
    }
}
